let express = require('express');
let router = express.Router();
let shoppingAndStarDao = require("../dao/ShoppingAndStarDao");
let pager = require("../util/PagerHelper")

/* GET users listing. */
router.all('/list.do', function(req, res, next) {
    pager.href ="/api/user/list.do";
    let table = "user",
        where = "",
        and = ""
    shoppingAndStarDao.getCount(table,where,and).then(count => {
        pager.setCount(count);
        return shoppingAndStarDao.findBy(table,where,and);
    }).then(data => {
        pager.data = data;
        res.json({
            code:200, //结果编码,200表示成功，404表示未找到
            data:pager
        });
    }).catch(err => next(err));
});







module.exports = router;
